﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

  <table data-toggle="table" class="table table-striped table-hover">
   <thead>
     <tr>
       <th data-align="center">门店</th>
       <th data-align="center">课程</th>
       <th data-align="center">类型</th>
       <th data-align="center">学员</th>
       <th data-align="center">金额</th>
       <th data-align="center">销售人员</th>
       <th data-align="center">购买/退款时间</th>
     </tr>
   </thead>
   <tbody>
     <c:forEach var="revenueReport" items="${revenueReports}">
       <tr>
         <td>${revenueReport.site.name}</td>
         <td>${revenueReport.course.give ? '1V1赠课' : revenueReport.course.name}</td>
         <td>${revenueReport.revenueType.description}</td>
         <td>${revenueReport.studentName}<br />${revenueReport.studentMobile}</td>
         <td>${revenueReport.offer/100}</td>
         <td>${empty revenueReport.salesman? '-' : revenueReport.salesman}</td>
         <td><fmt:formatDate value="${revenueReport.occurTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
       </tr>
     </c:forEach>
   </tbody>
  </table>

  <div class="form-horizontal clearfix" style="margin-top: 20px;">

    <div class="form-group pull-left" style="width: 60%">
      <label class="control-label col-xs-3">查询总计：</label>
      <div class="col-xs-4" style="padding-left: 0px;">
        <p class="form-control-static">${total} 条记录</p>
      </div>
    </div>

    <jsp:include page="/WEB-INF/include/page.jsp">
      <jsp:param name="url" value="revenue-reports/grid" />
      <jsp:param name="queryString" value="${queryString}" />
    </jsp:include>

  </div>

  <script>
  $("#grid-wrap table").bootstrapTable({
    height: 350,
    striped: true
  });
  </script>
